# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=kiwix-lib
_pkgname=libkiwix
pkgver=12.1.0
pkgrel=2
pkgdesc="Common code base for all Kiwix ports"
url="https://github.com/kiwix/libkiwix"
license="GPL-3.0-or-later"
arch="all"
depends="aria2"
makedepends="
	curl-dev
	gtest-dev
	icu-data-full
	libmicrohttpd-dev
	libzim-dev
	meson
	mustache
	pugixml-dev
	python3
	samurai
	xapian-core-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/kiwix/libkiwix/archive/$pkgver.tar.gz
	fix-build.patch
	"
subpackages="$pkgname-dev $pkgname-doc"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	abuild-meson . build
	ninja -C build
}

check() {
	meson test --print-errorlogs --no-rebuild -C build
}

package() {
	DESTDIR="$pkgdir" meson install -C build --no-rebuild
}

sha512sums="
9d4df7e46693a5aec545087ce37a2e83dfa3173a98e9d64cbbf364e1fd31143c30e856973cf12b0a2f608661d78a9453d8b748680c01f48e1df375c7b2b909d5  kiwix-lib-12.1.0.tar.gz
428c1865dcb35d572b34187b63234bc1ee72672259218a8d7e19b60a96953e1ef5392fd3d106f2bbf77bc405fb13106794acb8ce566695744f826a9b0fef8450  fix-build.patch
"
